package com.wechat.back.mapper;

import com.wechat.back.pojo.OperationLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

import java.util.List;

@Mapper
public interface OperationLogMapper {
    @Insert("INSERT INTO operation_log (opt_module, opt_uri, opt_type, opt_method, opt_desc, request_method, request_param, response_data, user_id, nickname, ip_address, ip_source, create_time, update_time) " +
            "VALUES (#{optModule}, #{optUri}, #{optType}, #{optMethod}, #{optDesc}, #{requestMethod}, #{requestParam}, #{responseData}, #{userId}, #{nickname}, #{ipAddress}, #{ipSource}, #{createTime}, #{updateTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insertLog(OperationLog operationLog);

    List<OperationLog> list(String optModule, String optType, String nickname, String requestMethod);
}

